/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mysimpatico.sqlwrapper;

import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author simpatico
 */
public class ResultList implements Component{

    private final List<Component> cols = new LinkedList<Component>();


    public void addNode(final Component node) {
        if(!cols.contains(node)) cols.add(node);
    }

    public void addNodes(final Component[] nodes){
         for(Component node: nodes){
            addNode(node);
        }
    }

    @Override
    public String toString() {
        String ret = "";
        boolean first = true;
        for (Component col : cols) {
            if (!first) {
                ret += ",";
            } else first = false;
            ret += col;
        }
        return ret;
    }
}
